
package org.apache.solr.logging.jul;

import java.util.logging.LogRecord;
import org.apache.solr.logging.LogWatcher;

public final class RecordHandler extends java.util.logging.Handler {

    final LogWatcher<LogRecord> framework;

    public RecordHandler(LogWatcher<LogRecord> framework) {
        this.framework = framework;
    }

    @Override
    public void close() throws SecurityException {
        //history.reset();
    }

    @Override
    public void flush() {
        // nothing
    }

    @Override
    public void publish(LogRecord r) {
        if(isLoggable(r)) {
            framework.add(r, r.getMillis());
        }
    }
}